﻿using System;
using EkStudio.com.bean.xml.reflection;
using EkStudio.com.bean.xml.RootInterface;

namespace EkStudio.com.bean.xml.BillReflect
{
    /// <summary>
    /// 反射配置信息节点
    /// </summary>
    public class BillRefectDataNode:BillObjectInterface
    {

        

        [Xml]
        public string Caption
        {
            get { return caption; }
            set { caption = value; }
        }
        [Xml]
        public string Key
        {
            get { return key; }
            set { key = value; }
        }
        [Xml]
        public bool Enable {
            get { return enable; }
            set { enable = value; }
        }
        [Xml]
        public string TargetKey
        {
            get { return targetKey; }
            set { targetKey = value; }
        }
        [Xml]
        public string TargetCaption
        {
            get { return targetCaption; }
            set { targetCaption = value; }
        }
        [Xml]
        public string RefectKey
        {
            get { return refectKey; }
            set { refectKey = value; }
        }
        [Xml]
        public string RefectCaption
        {
            get { return refectCaption; }
            set { refectCaption = value; }
        }
        [Xml]
        public string JavaPlugin
        {
            get { return javaPlugin; }
            set { javaPlugin = value; }
        }

        [XmlElement]
        public string Content
        {
            get { return content; }
            set { content = value; }
        }
        [XmlElement]
        public string TriggerMode
        {
            get { return triggerMode; }
            set { triggerMode = value; }
        }
        [XmlElement]
        public string Formula
        {
            get { return formula; }
            set { formula = value; }
        }

        public string FormulaCaption
        {
            get { return formulaCaption; }
            set { formulaCaption = value; }
        }

        [XmlElement]
        public BillRefectDataNodeOutList RefectValue
        {
            get { return refectValue;}
            set { refectValue = value; }
        }
        [XmlElement]
        public BillRefectDataNodeWhereList RefectWhere
        {
            get { return refectWhere; }
            set { refectWhere = value; }
        }
        [XmlTransient]
        public object ParentBean
        {
            get { return null; }
            set { }
        }

        public object Clone()
        {
            BillRefectDataNode clone = new BillRefectDataNode();
            clone.Key = Key;
            clone.Caption = Caption;
            clone.Enable = Enable;
            clone.TargetKey = TargetKey;
            clone.TargetCaption = TargetCaption;
            clone.RefectKey = RefectKey;
            clone.RefectCaption = RefectCaption; ;
            //clone.JavaPlugin = JavaPlugin;
            clone.TriggerMode = TriggerMode;
            clone.Content = Content;
            clone.Formula = Formula;
            clone.FormulaCaption = FormulaCaption;

            if (RefectValue != null)
            {
                clone.RefectValue = RefectValue.Clone() as BillRefectDataNodeOutList;
            }
            if(RefectWhere != null)
            {
                clone.RefectWhere = RefectWhere.Clone() as BillRefectDataNodeWhereList;
            }

            return clone;
        }

        private string caption = "数据反射";
        private string key = "Unname";
        private bool enable = true;
        private string targetKey = "";
        private string targetCaption = "请选择模块...";
        private string refectKey = "";
        private string refectCaption = "请选择模块...";
        private string javaPlugin = "[NULL]";
        private string triggerMode = "";

        private string content = "";

        private string formula = "";
        private string formulaCaption = "";

        private BillRefectDataNodeOutList refectValue = null;
        private BillRefectDataNodeWhereList refectWhere = null;
    }
}
